package cn.youframe.sample.transaction;

import cn.youframe.frame.base.BaseDaoImpl;
import cn.youframe.frame.util.SqlBuilder;

/**
 * User: Administrator
 * DateTime: 12-10-16 下午10:33
 * Desc:
 */
public class TransactionOraDaoImpl extends BaseDaoImpl implements TransactionOraDao {
    @Override
    public Object insertGetKey() {
        SqlBuilder sqlBuilder=new SqlBuilder();
        sqlBuilder.append("INSERT INTO BX_ORDER_INFO_T (ORDER_ID, CHANCE_ID, CUSTOMER_ID,  SUMPREMIUM,ECIFID)");
        sqlBuilder.append("VALUES ( to_char(sysdate,'yyyymmdd')||lpad(SEQ_BX_ORDER_INFO_T_ID.nextval,16,'0'),");
        sqlBuilder.append("fn_md5( to_char(sysdate,'yyyymmdd')||SEQ_BX_CUSTOMER_INFO_T_ID.nextval),");
        sqlBuilder.append("SEQ_BX_CUSTOMER_INFO_T_ID.nextval,?,?)");
        sqlBuilder.addArg(4986.89);
        sqlBuilder.addArg("ECCIFIDsdflkdslfdsjlfjsdlfjiiiiiiddddd");
        Object keyObj=insertAndGetKey(sqlBuilder.getSQL(),sqlBuilder.getArgArray(), new String[]{"ORDER_ID", "CHANCE_ID","CUSTOMER_ID","SUMPREMIUM","ECIFID"});
        return keyObj;
    }
}
